import request from '@/utils/request'

export default {
  //条件分页课程查询的方法
  getCourseList(page,limit,searchObj) {
    return request({
      url: `/eduservice/coursefront/getFrontCourseList/${page}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },
  //查询所有分类的方法
  getAllSubject() {
    return request({
      url: '/eduservice/edu-subject/getAll',
      method: 'get'
    })
  },
  //课程详情的方法
  getCourseInfo(id) {
    return request({
      url: '/eduservice/coursefront/getFrontCourseInfo/'+id,
      method: 'get'
    })
  },

  //插入评论
  addComment(eduComment) {
    return request({
      url: '/eduservice/edu-comment/addComment/',
      method: 'post',
      data: eduComment
    })
  },

  //显示评论列表
  commentList(courseId) {
    return request({
      url: '/eduservice/edu-comment/commentList/' + courseId,
      method: 'get'
    })
  },

  //课程浏览数加1
  increaseViewCount(courseId) {
    return request({
      url: '/eduservice/coursefront/increaseViewCount/' + courseId,
      method: 'post'
    })
  },

  //课程购买数加1
  increaseBuyCount(courseId) {
    return request({
      url: '/eduservice/coursefront/increaseBuyCount/' + courseId,
      method: 'post'
    })
  },
//课程章节的方法
getChapterVideoInfo(courseId) {
  return request({
    url: '/eduservice/coursefront/getChapterVideoInfo/'+courseId,
    method: 'get'
  })
},

}